package com.campus.service;

import com.campus.mapper.ActivityMapper;
import com.campus.entity.Activity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ActivityService1Impl implements ActivityService1 {
    @Autowired
    private ActivityMapper activityMapper;
    @Override
    public int saveActivity(Activity activity) {
       int i = activityMapper.insertActivity(activity);
       return i;
    }
    @Override
    public void updateActivity(Activity activity) {
        activityMapper.updateActivity(activity);
    }
    @Override
    public void publishActivity(int status, int id){
        activityMapper.updateActivityStatus(status,id);
    }
    @Override
    public List<Activity> selectActivityCreateTime(Integer status, String name) {
        return activityMapper.selectActivityByCreateTime(status,name);
    }
}
